import pyautogui
from source.event.event import Event

w, h = pyautogui.size()


class Monitor(Event):
    def changepos(self, pos: tuple):
        if self.event_type == 'Mouse':
            x, y = pos
            if isinstance(x, int):
                self.action[0] = x
            else:
                self.action[0] = int(x * w)
            if isinstance(y, int):
                self.action[1] = y
            else:
                self.action[1] = int(y * h)
